package com.xbongbong.paas.field;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * @author 吴峰
 * @version v1.0
 * @date 2019/2/25 10:45
 * @since v1.0
 */
@Getter
@Setter
@ToString
public class LinkInfoPojo implements Serializable {

    private static final long serialVersionUID = -2499317148684841327L;
    /**
     * 关联表对应的应用id
     */
    @NotNull(message = "请设置关联表")
    private Long linkAppId;

    /**
     * 关联表对应的表单id
     */
    @NotNull(message = "请设置关联表")
    private Long linkFormId;
    /**
     * 关联表对应的菜单id
     */
    @NotNull(message = "请设置关联表")
    private Long linkMenuId;

    /**
     * 关联表字段
     */
    private List<LinkedAttrPoJo> linkedAttr;

    /**
     * 关联表显示字段
     */
    private List<LinkedAttrPoJo> linkedShowAttr;

    /**
     * 关联条件，目前最多十个
     */
    private List<LinkConditionPoJo> condition;
    /**
     * 主键字段
     */
    private String linkKey;
    /**
     * 主键字段解释
     */
    private LinkKeyFieldInfoPojo linkKeyAttr;

    /**
     * 关联表单saas标识
     */
    private Integer linkSaasMark;

    /**
     * 关联表单业务类型
     */
    private Integer linkBusinessType;

    public LinkInfoPojo() {

    }

    public LinkInfoPojo( Long linkAppId, Long linkFormId, Long linkMenuId, Integer linkSaasMark, Integer linkBusinessType) {
        this.linkAppId = linkAppId;
        this.linkFormId = linkFormId;
        this.linkMenuId = linkMenuId;
        this.linkSaasMark = linkSaasMark;
        this.linkBusinessType = linkBusinessType;
    }
}
